<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/admintemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewCourseTitle}"></h:outputText>
        </ui:define>
        <ui:define name="leftmenu">
            <h:form>
                <ul class="section menu">
                    <li><a class="menuitem">#{bundle.ControlPanelMenu}</a>
                        <ul class="submenu">
                            <li><h:commandLink action="#{courseController.prepareCreate}" value="#{bundle.ListCourseCreateLink}"/> </li>
                            <li><h:commandLink action="#{courseController.prepareList}" value="#{bundle.CreateCourseShowAllLink}" immediate="true"/> </li>
                        </ul>
                    </li>
                </ul>
            </h:form>
        </ui:define>
        <ui:define name="content">
            <h2>#{bundle.ViewCourseTitle}</h2>
            <div class="block">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
                </h:panelGroup>
                <h:form>
                    <table class="form">
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ViewCourseLabel_courseId}"/>
                            </td>
                            <td class="col2">
                                <h:outputText value="#{courseController.selected.courseId}" title="#{bundle.ViewCourseTitle_courseId}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ViewCourseLabel_courseName}"/>
                            </td>
                            <td class="col2">
                                <h:outputText value="#{courseController.selected.courseName}" title="#{bundle.ViewCourseTitle_courseName}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ViewCourseLabel_assignmentFile}"/>
                            </td>
                            <td class="col2">
                                <a href=" #{courseController.linkDownload(courseController.selected.assignmentFile)}">#{courseController.selected.assignmentFile}</a>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ViewCourseLabel_startDate}"/>
                            </td>
                            <td class="col2">
                                <h:outputText value="#{courseController.selected.startDate}" title="#{bundle.ViewCourseTitle_startDate}">
                                    <f:convertDateTime pattern="MM/dd/yyyy" />
                                </h:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ViewCourseLabel_endDate}"/>
                            </td>
                            <td class="col2">
                                <h:outputText value="#{courseController.selected.endDate}" title="#{bundle.ViewCourseTitle_endDate}">
                                    <f:convertDateTime pattern="MM/dd/yyyy" />
                                </h:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ViewCourseLabel_status}"/>
                            </td>
                            <td class="col2">
                                <h:outputText value="#{courseController.selected.status}" title="#{bundle.ViewCourseTitle_status}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputText value="#{bundle.ListTopicTitle_topicName}"/>
                            </td>
                            <td class="col2">
                                <h:outputText value="#{courseController.selected.topicId.topicName}" title="#{bundle.ViewCourseTitle_topicId}"/>
                            </td>
                        </tr>
                    </table>
                    <h:commandLink action="#{courseController.destroyAndView}" class="btn-icon btn-teal btn-cross btn-small">
                        <span></span>
                        #{bundle.ViewCourseDestroyLink}
                    </h:commandLink>&nbsp;
                    <h:link outcome="Edit" class="btn-icon btn-teal btn-arrow-right btn-small">
                        <span></span>
                        #{bundle.ViewCourseEditLink}
                    </h:link>
                </h:form>
            </div>
        </ui:define>
    </ui:composition>

</html>
